<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="12">
            <a-form-item label="职系编码" :label-col="labelCol" :wrapper-col="wrapperCol">
              <a-input v-model="queryParam.code"  placeholder="请输入职系编码" />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="12">
            <a-form-item label="职系名称" :label-col="labelCol" :wrapper-col="wrapperCol">
              <a-input v-model="queryParam.name"  placeholder="请输入职系名称" />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item>
              <a-button type="primary" icon="search" @click="searchQuery()">查询</a-button>
              <a-button type="primary" icon="reload" style="margin-left: 8px" @click="searchReset()">重置</a-button>
              <a style="margin-left: 8px" @click="handleToggleSearch">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
              </a>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <vxe-grid
      id="PostTypeList"
      ref="vxeTable"
      :height="height"
      v-bind="gridOptions"
      v-on="listeners"
    >
      <template #action="{ row }">
        <a @click="handleEdit(row)" >编辑</a>
        <a-divider type="vertical" />
        <a-dropdown>
          <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
          <a-menu slot="overlay">
            <a-menu-item>
              <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(row.id)">
                <a>删除</a>
              </a-popconfirm>
            </a-menu-item>
          </a-menu>
        </a-dropdown>
      </template>
    </vxe-grid>
    <!-- 表单区域 -->
    <PostTypeModal ref="modalForm" @ok="modalFormOk" />
  </a-card>
</template>

<script>
import PostTypeModal from './modules/PostTypeModal'
import VxeTableListMixin from '@/mixins/VxeTableListMixin'

export default {
  name: 'PostTypeList',
  mixins: [VxeTableListMixin],
  components: {
    PostTypeModal
  },
  data() {
    return {
      description: '职系管理',
      columns: [
        { type: 'checkbox', width: 40 },
        { type: 'seq', width: 40 },
        { title: '职系编码', field: 'code' },
        { title: '职系名称', field: 'name' },
        // { title: '描述', field: 'desc' },
        // { title: '状态', field: 'status', slots: { default: 'status' }},
        { title: '操作', slots: { default: 'action' }, width: 120 }
      ],
      url: {
        list: '/posttype/page',
        delete: '/posttype/remove/',
        deleteBatch: '/posttype/remove/'
      }
    }
  },
  methods: {

  }
}
</script>
